function showData(num) {
	for(var i = 1; i <= 3; i++) {
		document.getElementById("d"+i).style.display = "none";
	}
	document.getElementById("d"+num).style.display = "block";
}

function showWifi(obj){
	var div = document.getElementById("addWifi");
	if(obj.value == "Be Wi-Fi Repeater"){
		div.style.visibility = "hidden";
		obj.value = "Be Wi-Fi Repeater↓"
	}else{
		div.style.visibility = "visible";
		obj.value = "Be Wi-Fi Repeater";
	}
}

function connectWifi(obj){
	var team = document.getElementById("conWifi");
	
	//ssid
	var newdiv = document.createElement("div");
	newdiv.class = "form-group";
	var newlabel = document.createElement("label");
	newlabel.class = "control-label";
	newlabel.innerHTML = "SSID:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp";
	var newInput = document.createElement("label");
	newInput.class = "control-label";
	newInput.innerHTML = obj.innerHTML;
	newInput.placeholder = "账号";
	
	//passwd
	var newdiv2 = document.createElement("div");
	newdiv2.class = "form-group";
	var newlabel2 = document.createElement("label");
	newlabel2.class = "control-label";
	newlabel2.innerHTML = "passwd:&nbsp";
	var newInput2 = document.createElement("input");
	newInput2.type = "password";
	newInput2.class = "form-control";
	newInput2.placeholder = "密码";
	
	var newSub = document.createElement("button");
	newSub.type = "submit";
	newSub.class = "btn btn-default";
	newSub.innerHTML = "connect";
	
	team.appendChild(newdiv);
	team.appendChild(newlabel);
	team.appendChild(newInput);
	team.appendChild(newdiv2);
	team.appendChild(newlabel2);
	team.appendChild(newInput2);
	team.appendChild(newSub);
}



